package com.changgou.task;

import com.changgou.config.RabbitMQConfig;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.slf4j.Logger;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

@Component
public class OrderTask  {

    @Autowired
    private RabbitTemplate rabbitTemplate;
    @Autowired
    private Logger logger;

    @XxlJob("autoTake")
    public ReturnT<String> autoTake(String s) throws Exception {
        logger.info(LocalDateTime.now()+"执行自动收货");
        rabbitTemplate.convertAndSend("", RabbitMQConfig.ORDER_TACK,"-");
        return ReturnT.SUCCESS;
    }
}
